// import React from "react";
import React from "./react";


function Child (props){
  const {handle,data} = props
  console.log('Child render')
  return ( <button onClick={handle}>{data.number}</button>)
}
const MemoChild = React.memo(Child)
function App (){
  const [name,setName] = React.useState('ljp')
  const [number,setNumber] = React.useState(0)
  const data = React.useMemo(()=>({number}),[number])
  const handle = React.useCallback(()=> setNumber(number+1),[number])
  console.log('App render')
  return <div>
    <input onChange={(e)=>setName(e.target.value)} value={name} />
    <MemoChild  data={data} handle={handle} />
  </div>
}
export default App